<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 方法三 */
        /* 清除浮动- :after伪元素法 */
/* 谁需要清除浮动就给他的父元素（一般是box 后面加一个类名clearfix） 把以下代码复制粘贴即可。 */
        .clearfix:after {
            content:"";
           display:block;
            height:0;
            clear: both;
            visibility: hiden;
        }

        .clearfix {
            /* ie6、7专用*/
            *zoom:1;
        }

        /* br */
        .box {
            width: 800px;
            border: 1px solid blue;
            margin: 0 auto;
        }

        .damao {
            float: left;
            width: 300px;
            height: 200px;
            background-color: purple;
        }

        .ermao {
            float: left;
            width: 200px;
            height: 200px;
            background-color: red;
        }

        .footer {
            height: 200px;
            background-color: black;
        }
    </style>
</head>

<body>
    <div class="box clearfix">
        <div class="damao">大毛</div>
        <div class="ermao">二毛</div>
     

    </div>
    <div class="footer"></div>
</body>

</html>